package cn.hc.tool.exec.bean;

import lombok.Data;

import java.lang.reflect.Method;
import java.util.LinkedHashSet;
import java.util.Set;

/**
 * @author huangchao E-mail:fengquan8866@163.com
 * @version 创建时间：2024/9/24 20:35
 */
@Data
public class MethodRes {

    /**
     * 入参符合扫描条件的方法
     */
    private Set<Method> reqMethod = new LinkedHashSet<Method>();
    /**
     * 出参符合扫描条件的方法
     */
    private Set<Method> returnMethod = new LinkedHashSet<Method>();
    /**
     * 出参可能符合扫描条件的方法
     */
    private Set<Method> maybeMethod = new LinkedHashSet<Method>();

    public boolean addReqMethod(Method m) {
        return reqMethod.add(m);
    }

    public boolean hasReqMethod(Method m) {
        return reqMethod.contains(m);
    }

    public boolean addReturnMethod(Method m) {
        return returnMethod.add(m);
    }

    public boolean hasReturnMethod(Method m) {
        return returnMethod.contains(m);
    }

    public boolean addMaybeMethod(Method m) {
        return maybeMethod.add(m);
    }

    public boolean hasMaybeMethod(Method m) {
        return maybeMethod.contains(m);
    }
}
